package com.zhaopin.thread;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.LockSupport;

/**
 * @author yin.peide
 * @date 2021-06-23 9:59
 */
public class ParkTest {

    public static void main(String[] args) throws InterruptedException {

        ParkTest room = new ParkTest();

        AtomicBoolean flag = new AtomicBoolean(false);
        Thread t1 = new Thread(() -> {

            System.out.println("等待一秒");
            LockSupport.park();

            System.out.println("解锁了");

        },"t1");
        t1.start();

        Thread.sleep(2000);
        t1.interrupt();
        System.out.println(t1.isInterrupted());
//        LockSupport.unpark(t1);




    }

}
